package app.project.directionlensproject;

import java.util.Locale;

import android.app.Application;
import android.content.Context;
import android.content.res.Configuration;
import android.content.res.Resources;
import app.project.directionlensproject.util.CommonUtils;
import app.project.directionlensproject.util.Constants;

public class MyApplication extends Application {
	private static MyApplication instance;
	public static boolean isListForAll=true;
	
	
	public static Context getAppContext() {
		return instance.getApplicationContext();
	}

	public void onCreate() {
		super.onCreate();
		instance = this;
	}

	public void onLowMemory() {
		super.onLowMemory();
		Runtime.getRuntime().gc();
	}
	
//    @Override
//    public void onConfigurationChanged(Configuration newConfig) {
//        super.onConfigurationChanged(newConfig);
//        setLocale();
//    }
//
//    private void setLocale() {
//        Resources res = this.getResources();
//        Configuration conf = new Configuration(res .getConfiguration());
//        boolean isEnglish=CommonUtils.getBooleanSetting(getApplicationContext(), Constants.IS_EN, true);
//        if(isEnglish){
//        	conf.locale = Locale.ENGLISH;
//        }else{
//        	conf.locale = new Locale("vi");
//        }        
//
//        res.updateConfiguration(conf, res.getDisplayMetrics());
//    }
}
